#!/bin/bash
. /usr/libexec/yadt/util
. /etc/default/yadt

LOG_DIR=$YADT_LOG_DIR/$(date +%Y-%m-%d)
LOG_FILE=$LOG_DIR/$(basename $0).$(date +%Y-%m-%d--%H-%M-%S).$(hostname -s).log

umask 002
mkdir -p $LOG_DIR
exec > $LOG_FILE 2>&1

housekeeping -d $YADT_LOG_DIR -c 7
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t yadt-housekeeping "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
